<!DOCTYPE html>
<!--
  Copyright 2010 Google Inc.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

  Original slides: Marcin Wichary (mwichary@google.com)
  Modifications: Ernest Delgado (ernestd@google.com)
                 Alex Russell (slightlyoff@chromium.org)

  landslide modifications: Adam Zapletal (adamzap@gmail.com)
                           Nicolas Perriault (nperriault@gmail.com)
-->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>docker学习</title>
    <!-- Styles -->
    
    <link rel="stylesheet" media="print" href="file://c:\python27\lib\site-packages\landslide\themes\default\css\print.css">
    <link rel="stylesheet" media="screen, projection" href="file://c:\python27\lib\site-packages\landslide\themes\default\css\screen.css">
    
    
    <!-- /Styles -->
    <!-- Javascripts -->
    
    <script type="text/javascript" src="file://c:\python27\lib\site-packages\landslide\themes\default\js\slides.js"></script>
    
    
    
    <!-- /Javascripts -->
</head>
<body>
  <div id="blank"></div>
  <div class="presentation">
    <div id="current_presenter_notes">
      <div id="presenter_note"></div>
    </div>
    <div class="slides">
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-1">
          <div class="inner">
            
            <header><h1>docker学习</h1></header>
            
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              1/10
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-2">
          <div class="inner">
            
            <header><h3>docker是什么</h3></header>
            
            
            <section><ul>
<li>Docker 是一个开源的应用容器引擎，基于 Go 语言 并遵从Apache2.0协议开源</li>
</ul>
<h3>Docker的应用场景</h3>
<ul>
<li>Web 应用的自动化打包和发布。</li>
<li>自动化测试和持续集成、发布。</li>
<li>在服务型环境中部署和调整数据库或其他的后台应用。</li>
<li>从头编译或者扩展现有的OpenShift或Cloud Foundry平台来搭建自己的PaaS环境。</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              2/10
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-3">
          <div class="inner">
            
            <header><h3>Docker 的优点</h3></header>
            
            
            <section><h4>简化程序</h4>
<ul>
<li>Docker让开发者可以打包他们的应用以及依赖包到一个可移植的容器中，然后发布到任何流行的 Linux 机器上，便可以实现虚拟化。Docker改变了虚拟化的方式，使开发者可以直接将自己的成果放入Docker中进行管理。方便快捷已经是 Docker的最大优势，过去需要用数天乃至数周的任务，在Docker容器的处理下，只需要数秒就能完成。</li>
</ul>
<h4>避免选择恐惧症</h4>
<ul>
<li>如果你有选择恐惧症，还是资深患者。Docker 镜像中包含了运行环境和配置，所以 Docker 可以简化部署多种应用实例工作。比如 Web 应用、后台应用、数据库应用、消息队列等等都可以打包成一个镜像部署。</li>
</ul>
<h4>节省开支</h4>
<ul>
<li>一方面，云计算时代到来，使开发者不必为了追求效果而配置高额的硬件，Docker改变了高性能必然高价格的思维定势。Docker与云的结合，让云空间得到更充分的利用。不仅解决了硬件管理的问题，也改变了虚拟化的方式。</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              3/10
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-4">
          <div class="inner">
            
            <header><h3>安装docker(centos)</h3></header>
            
            
            <section><h4>原始源安装</h4>
<ul>
<li>yum -y install docker</li>
</ul>
<h4>阿里云源安装</h4>
<ul>
<li>安装必要的一些系统工具<ul>
<li>sudo yum install -y yum-utils device-mapper-persistent-data lvm2</li>
</ul>
</li>
<li>添加软件源信息<ul>
<li>sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo</li>
</ul>
</li>
<li>更新并安装 Docker-CE<ul>
<li>sudo yum makecache fast</li>
<li>sudo yum -y install docker-ce</li>
</ul>
</li>
<li>开启Docker服务<ul>
<li>sudo service docker start</li>
</ul>
</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              4/10
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-5">
          <div class="inner">
            
            <header><h3>镜像加速</h3></header>
            
            
            <section><ul>
<li>鉴于国内网络问题，后续拉取 Docker 镜像十分缓慢，我们可以需要配置加速器来解决。</li>
<li>阿里云加速<ul>
<li>可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器</li>
<li>加速代码获取地址：https://cr.console.aliyun.com/#/accelerator
<img alt="add" src="https://linux-study.oss-cn-beijing.aliyuncs.com/docker/QQ%E6%88%AA%E5%9B%BE20180717181929.png?Expires=1531999150&amp;OSSAccessKeyId=TMP.AQEcDhFyBqz1YcmjrxjoAoVnFGEYZofXFfNV2ct5jFLZ91BydFRrUVTm6qAsADAtAhRsFQl3efrhw96ZT55IJuC5UgaxRAIVAJ4YNK9IZpfOqEtzgiSL63ujkJbO&amp;Signature=b3uZ2NkD0xYsejI2yp%2FHLrfX52k%3D" /></li>
</ul>
</li>
</ul>
<h3>docker容器获取</h3>
<ul>
<li>容器获取地址：<ul>
<li>docker官网：https://hub.docker.com/</li>
<li>阿里云：https://dev.aliyun.com/search.html</li>
</ul>
</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              5/10
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-6">
          <div class="inner">
            
            <header><h3>docker容器使用</h3></header>
            
            
            <section><ul>
<li>docker pull</li>
<li>dockerfile</li>
<li>docker-compose</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              6/10
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-7">
          <div class="inner">
            
            <header><h3>docker pull</h3></header>
            
            
            <section><ul>
<li>下载镜像<ul>
<li>docker pull nginx:version</li>
<li><img alt="docker-pull" src="https://linux-study.oss-cn-beijing.aliyuncs.com/docker/docker-pull.png?Expires=1531999173&amp;OSSAccessKeyId=TMP.AQEcDhFyBqz1YcmjrxjoAoVnFGEYZofXFfNV2ct5jFLZ91BydFRrUVTm6qAsADAtAhRsFQl3efrhw96ZT55IJuC5UgaxRAIVAJ4YNK9IZpfOqEtzgiSL63ujkJbO&amp;Signature=39%2FfWdJOILLo7V0fGgZ%2BMz3Z1aw%3D" /></li>
</ul>
</li>
<li>查看下载的镜像<ul>
<li>docker images</li>
</ul>
</li>
<li>运行容器<ul>
<li>docker run -it -d --name nginx -p 80:80 nginx:version /bin/bash</li>
<li>-i 以交互模式运行容器，通常与 -t 同时使用</li>
<li>-t 为容器重新分配一个伪输入终端，通常与 -i 同时使用</li>
<li>-d 后台运行容器，并返回容器ID</li>
<li>-p 端口映射，格式为：主机(宿主)端口:容器端口</li>
<li>--name 设置别名</li>
</ul>
</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              7/10
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-8">
          <div class="inner">
            
            <header><h3>dockerfile</h3></header>
            
            
            <section><ul>
<li>下载dockerfile<ul>
<li>git clone https://github.com/nginxinc/docker-nginx.git</li>
</ul>
</li>
<li>构建docker镜像<ul>
<li>docker build docker-nginx/stable/alpine</li>
</ul>
</li>
<li>查看容器<ul>
<li>docker images</li>
</ul>
</li>
<li>启动容器<ul>
<li>docker run imageId</li>
</ul>
</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              8/10
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-9">
          <div class="inner">
            
            <header><h3>docker容器管理</h3></header>
            
            
            <section><ul>
<li>查看所有容器<ul>
<li>docker ps</li>
</ul>
</li>
<li>关闭容器<ul>
<li>docker stop nginx</li>
</ul>
</li>
<li>开启容器<ul>
<li>docker start nginx</li>
</ul>
</li>
<li>容器信息<ul>
<li>docker inspect nginx</li>
</ul>
</li>
<li>容器运行状态<ul>
<li>docker stats nginx</li>
</ul>
</li>
</ul></section>
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              9/10
            </aside>
          </footer>
        </div>
      </div>
      
      <!-- slide source: docker.md -->
      <div class="slide-wrapper">
        <div class="slide slide-10">
          <div class="inner">
            
            <header><h1>谢谢！</h1></header>
            
            
          </div>
          <div class="presenter_notes">
            <header><h1>Presenter Notes</h1></header>
            <section>
            
            </section>
          </div>
          <footer>
            
            <aside class="source">
              Source: <a href="docker.md">docker.md</a>
            </aside>
            
            <aside class="page_number">
              10/10
            </aside>
          </footer>
        </div>
      </div>
      
    </div>
  </div>
  
  <div id="toc" class="sidebar hidden">
    <h2>Table of Contents</h2>
    <table>
      <caption>Table of Contents</caption>
      
      <tr id="toc-row-1">
        <th><a href="#slide1">docker学习</a></th>
        <td><a href="#slide1">1</a></td>
      </tr>
      
      
      <tr id="toc-row-2">
        <th><a href="#slide2">-</a></th>
        <td><a href="#slide2">2</a></td>
      </tr>
      
      
      <tr id="toc-row-3">
        <th><a href="#slide3">-</a></th>
        <td><a href="#slide3">3</a></td>
      </tr>
      
      
      <tr id="toc-row-4">
        <th><a href="#slide4">-</a></th>
        <td><a href="#slide4">4</a></td>
      </tr>
      
      
      <tr id="toc-row-5">
        <th><a href="#slide5">-</a></th>
        <td><a href="#slide5">5</a></td>
      </tr>
      
      
      <tr id="toc-row-6">
        <th><a href="#slide6">-</a></th>
        <td><a href="#slide6">6</a></td>
      </tr>
      
      
      <tr id="toc-row-7">
        <th><a href="#slide7">-</a></th>
        <td><a href="#slide7">7</a></td>
      </tr>
      
      
      <tr id="toc-row-8">
        <th><a href="#slide8">-</a></th>
        <td><a href="#slide8">8</a></td>
      </tr>
      
      
      <tr id="toc-row-9">
        <th><a href="#slide9">-</a></th>
        <td><a href="#slide9">9</a></td>
      </tr>
      
      
      <tr id="toc-row-10">
        <th><a href="#slide10">谢谢！</a></th>
        <td><a href="#slide10">10</a></td>
      </tr>
      
      
    </table>
  </div>
  
  <div id="help" class="sidebar hidden">
    <h2>Help</h2>
    <table>
      <caption>Help</caption>
      <tr>
        <th>Table of Contents</th>
        <td>t</td>
      </tr>
      <tr>
        <th>Exposé</th>
        <td>ESC</td>
      </tr>
      <tr>
        <th>Full screen slides</th>
        <td>e</td>
      </tr>
      <tr>
        <th>Presenter View</th>
        <td>p</td>
      </tr>
      <tr>
        <th>Source Files</th>
        <td>s</td>
      </tr>
      <tr>
        <th>Slide Numbers</th>
        <td>n</td>
      </tr>
      <tr>
        <th>Toggle screen blanking</th>
        <td>b</td>
      </tr>
      <tr>
        <th>Show/hide slide context</th>
        <td>c</td>
      </tr>
      <tr>
        <th>Notes</th>
        <td>2</td>
      </tr>
      <tr>
        <th>Help</th>
        <td>h</td>
      </tr>
    </table>
  </div>
  <script>main()</script>
</body>
</html>